FROM ubuntu:latest
ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive

RUN sed -i 's#\(archive\|security\).ubuntu.com#mirrors.aliyun.com#g' /etc/apt/sources.list \
    && apt-get update -y && apt-get upgrade -y \
    && apt-get install -y --no-install-recommends \
    cron \
    wget \
    unzip \
    git \
    ssh-client \
    tzdata \
    && apt-get clean -y && apt-get autoclean -y \
    && ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa \
    && git config --global user.email auto_qqwry_update@eecjimmy.qqwry.data \
    && git config --global user.name auto_qqwry_update \
    && ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
    && echo ${TZ} > /etc/timezone \
    && dpkg-reconfigure --frontend noninteractive tzdata  \
    && rm -fr /var/lib/apt/lists/*

COPY .ssh /root/.ssh
COPY crontab /etc/crontab
RUN chmod 644 /etc/crontab

WORKDIR /app
ENTRYPOINT [ "cron", "-l", "2", "-f" ]
# ENTRYPOINT [ "tail", "-f", "/etc/crontab" ]